import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:riverpod_t/page/car/data/model/info_model.dart';
import 'package:riverpod_t/routers/navigator_utils.dart';
import 'package:riverpod_t/widget/app_net_image.dart';
import 'package:riverpod_t/widget/custom_button.dart';

class ArticleNavWidget extends StatelessWidget {
  final InfoListModel? infoListModel;
  const ArticleNavWidget({super.key, this.infoListModel});

  @override
  Widget build(BuildContext context) {
    /// 导航栏
    return Container(
      padding: EdgeInsets.only(right: 15.w, top: ScreenUtil().statusBarHeight + 5.h),
      width: 1.sw,
      color: const Color(0xFFF6F9FF),
      height: ScreenUtil().statusBarHeight + kToolbarHeight,
      alignment: Alignment.center,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              CustomButton(
                width: 40.w,
                height: ScreenUtil().statusBarHeight + kToolbarHeight,
                onPressed: () {
                  NavigatorUtils.pop(context);
                },
                iconName: "assets/images/back_black.png",
                iconFit: BoxFit.cover,
                iconWidth: 26.w,
                iconHeight: 26.w,
              ),

              AppNetImage(
                imageUrl: infoListModel?.mcnIcon ?? '',
                width: 36.w,
                height: 36.w,
                radius: 18.w,
              ),
              SizedBox(width: 8.w),
              Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    infoListModel?.mcnRealName ?? '',
                    style: TextStyle(
                      color: Colors.black87,
                      fontWeight: FontWeight.w600,
                      fontSize: 15.sp,
                    ),
                  ),
                  Text(
                    '浏览量 ${infoListModel?.pageViewStr ?? ''}  粉丝 ${infoListModel?.mcnFansCount ?? ''}',
                    style: TextStyle(
                      color: Colors.black45,
                      fontSize: 13.sp,
                      fontWeight: FontWeight.w400,
                    ),
                  ),
                ],
              ),
            ],
          ),
          CustomButton(
            width: 50.w,
            height: 26.h,
            text: '关注',
            borderRadius: 13.sp,
            borderColor: Colors.black45,
            borderWidth: 1.w,
            textStyle: TextStyle(color: Colors.black, fontSize: 12.sp, fontWeight: FontWeight.w400),
          ),
        ],
      ),
    );
  }
}
